package com.ljs.myspringboot.config;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;

public class Mytimer {
    public static void main(String[] args) throws ParseException {
        Timer timer = new Timer();
        TestTask testTask = new TestTask();
        /*  timer.schedule(testTask,new Date());*/
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        Date date = simpleDateFormat.parse("2020-10-3 21:53:50");
        /*    timer.schedule(testTask,date);*/
        timer.schedule(testTask, new Date(), 2000);
    }
}
